package com.lintf.web.controller.bot;

import com.lintf.bot.domain.dto.BotGroupInviteAddDTO;
import com.lintf.bot.domain.dto.BotGroupInviteListDTO;
import com.lintf.bot.domain.dto.BotGroupInviteUpdateDTO;
import com.lintf.bot.service.IBotGroupInviteService;
import com.lintf.common.core.controller.BaseController;
import com.lintf.common.core.domain.AjaxResult;
import com.lintf.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author lin tingfeng
 * @system Mac
 * @data 2024/3/14 10:00
 * @package_name com.lintf.web.controller.bot
 * @project_name mobile-project
 * @desc
 */
@RequestMapping("/bot/group/invite")
@RestController
public class BotGroupInviteController extends BaseController {

    @Autowired
    private IBotGroupInviteService botGroupInviteService;

    @GetMapping("/list")
    public TableDataInfo list(BotGroupInviteListDTO dto) {
        startPage();
        return getDataTable(botGroupInviteService.list(dto));
    }

    @GetMapping("/getOneOfReview")
    public AjaxResult getOneOfReview(BotGroupInviteListDTO dto) {
        return AjaxResult.success(botGroupInviteService.getOneOfReview(dto));
    }

    @GetMapping("/getOneOfUser")
    public TableDataInfo getOneOfUser(BotGroupInviteListDTO dto) {
        return getDataTable(botGroupInviteService.getOneOfUser(dto));
    }

    @GetMapping("/getGroupOfUser")
    public TableDataInfo getGroupOfUser(BotGroupInviteListDTO dto) {
        return getDataTable(botGroupInviteService.getGroupOfUser(dto));
    }

    @PostMapping("/add")
    public AjaxResult add(@RequestBody BotGroupInviteAddDTO dto) {
        botGroupInviteService.add(dto);
        return AjaxResult.success();
    }

    @PostMapping("/update")
    public AjaxResult update(@RequestBody BotGroupInviteUpdateDTO dto) {
        botGroupInviteService.update(dto);
        return AjaxResult.success();
    }

    @PostMapping("/remove")
    public AjaxResult remove(@RequestBody BotGroupInviteUpdateDTO dto) {
        botGroupInviteService.remove(dto);
        return AjaxResult.success();
    }

}
